class P10196 {

	static char[][] board;
	
	public static void main(String[] args) {
		try {
		readBoard();
		int counter = 1;
		while(!emptyBoard()) {
			process(counter);
			counter++;
			readLn();
			readBoard();
		}
		} catch (Exception e) {
			while(true) {
				
			}
		}
	}

	private static void process(int counter) {
		System.out.print("Game #" + counter+": ");
		for (int k = 0; k < 8; k++) {
			for (int j = 0; j < 8; j++) {
				if (board[k][j] != '.'  && checkCheck(k, j)) {
					char piece = board[k][j];
					if (piece >= 'A' && piece <= 'Z') {
						System.out.println("black king is in check.");
					} else {
						System.out.println("white king is in check.");
					}
					return;
				}
			}
		}
		System.out.println("no king is in check.");
	}

	private static boolean checkCheck(int k, int j) {
		char piece = board[k][j];
		
		switch (piece) {
			case 'p':
				return checkPawn(k, j, true);
			case 'P':
				return checkPawn(k, j, false);
			case 'r':
				return checkRook(k, j, true);
			case 'R':
				return checkRook(k, j, false);
			case 'b':
				return checkBishop(k, j, true);
			case 'B':
				return checkBishop(k, j, false);
			case 'q':
				return checkQueen(k, j, true);
			case 'Q':
				return checkQueen(k, j, false);
//			case 'k':
//				return checkKing(k, j, true);
//			case 'K':
//				return checkKing(k, j, false);
			case 'n':
				return checkKnight(k, j, true);
			case 'N':
				return checkKnight(k, j, false);
		}
		
		
		return false;
	}

	
	private static boolean checkKnight(int i, int j, boolean black) {
		
		int y = i + 2;
		int x = j + 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		y = i + 1;
		x = j + 2;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		y = i - 1;
		x = j + 2;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}


		y = i - 2;
		x = j + 1;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		y = i - 2;
		x = j - 1;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}


		y = i - 1;
		x = j - 2;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}


		y = i + 1;
		x = j - 2;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		y = i + 2;
		x = j - 1;

		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		return false;
	}

	private static boolean checkKing(int i, int j, boolean black) {
		int x = j + 1;
		int y = i + 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j - 1;
		y = i - 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j + 1;
		y = i - 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j - 1;
		y = i + 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j + 1;
		y = i;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j - 1;
		y = i;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j;
		y = i + 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		x = j;
		y = i - 1;
		
		if (insideBoard(y, x)) {
			char where = board[y][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 			
		}

		return false;
	}

	private static boolean checkQueen(int i, int j, boolean black) {
		for (int k = 1; insideBoard(i+k, j+k); k++) {
			char where = board[i+k][j+k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}
		
		for (int k = 1; insideBoard(i-k, j-k); k++) {
			char where = board[i-k][j-k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}

		for (int k = 1; insideBoard(i-k, j+k); k++) {
			char where = board[i-k][j+k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}

		for (int k = 1; insideBoard(i+k, j-k); k++) {
			char where = board[i+k][j-k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}
		

		for (int x = j+1; insideBoard(i, x); x++) {
			char where = board[i][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}
		
		for (int x = j-1; insideBoard(i, x); x--) {
			char where = board[i][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}

		for (int y = i+1; insideBoard(y, j); y++) {
			char where = board[y][j];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}

		for (int y = i-1; insideBoard(y, j); y--) {
			char where = board[y][j];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}		
		return false;
	}

	private static boolean checkBishop(int i, int j, boolean black) {
		for (int k = 1; insideBoard(i+k, j+k); k++) {
			char where = board[i+k][j+k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}
		
		for (int k = 1; insideBoard(i-k, j-k); k++) {
			char where = board[i-k][j-k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}

		for (int k = 1; insideBoard(i-k, j+k); k++) {
			char where = board[i-k][j+k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}

		for (int k = 1; insideBoard(i+k, j-k); k++) {
			char where = board[i+k][j-k];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}			
		}

		return false;
	}

	private static boolean checkRook(int i, int j, boolean black) {
		for (int x = j+1; insideBoard(i, x); x++) {
			char where = board[i][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}
		
		for (int x = j-1; insideBoard(i, x); x--) {
			char where = board[i][x];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}

		for (int y = i+1; insideBoard(y, j); y++) {
			char where = board[y][j];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}

		for (int y = i-1; insideBoard(y, j); y--) {
			char where = board[y][j];
			if (black) {
				if (where == 'K') {
					return true;
				}
			} else {
				if (where == 'k') {
					return true;
				}				
			} 
			
			if (where != '.') {
				break;
			}
		}
		return false;
	}

	private static boolean insideBoard(int i, int j) {
		return i >= 0 && i < 8 && j >= 0 && j < 8;  
	}
	
	// white -> uppercase -> bottom -> attack to the top -> -
	// black -> lowercase -> top -> attack to the bottom -> +
	private static boolean checkPawn(int i, int j, boolean black) {
		if (black) {
			int y = i + 1;
			int x = j + 1;
			if (insideBoard(y, x) && board[y][x] == 'K') {
				return true;
			}			
			y = i + 1;
			x = j - 1;
			if (insideBoard(y, x) && board[y][x] == 'K') {
				return true;
			}
		} else {
			int y = i - 1;
			int x = j + 1;
			if (insideBoard(y, x) && board[y][x] == 'k') {
				return true;
			}			
			y = i - 1;
			x = j - 1;
			if (insideBoard(y, x) && board[y][x] == 'k') {
				return true;
			}			
		}
		return false;
	}

	private static boolean emptyBoard() {
		for (int k = 0; k < 8; k++) {
			for (int j = 0; j < 8; j++) {
				if (board[k][j] != '.') {
					return false;
				}
			}
		}
		return true;
	}

	private static void readBoard() {
		board = new char[8][8];
		for (int k =  0; k < 8; k++) {
			String line = readLn();
			for (int j = 0; j < 8; j++) {
				board[k][j] = line.charAt(j);
			}
		}
		
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

}
